<template>
    <div>
      <el-form >
        <el-form-item class="cancel" label="由于您不是vip需要进行收费，是否支付？">
        </el-form-item>
        <el-form-item>
          <a :href=this.url @click="onSubmit" class="btn btn-success btn-lg btn-block btn-check " style="width: 30%;margin: auto;" >支付{{price}}元</a>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
  export default {
    name: 'isNotVip',
    data(){
      return {
        url: '',
        price:'',
        priceList: [],
      }
    },
    methods:{
      onSubmit(){
        var opid = localStorage.getItem("Opid");
        this.url = "http://cy1996.natapp1.cc/payNormal?openid="+opid+"&price="+this.price;
      },
      vipPrice() {
        this.$ajax.get('http://47.75.110.31:8080/adinfo/findByAccount?account=2')
          .then(response => {
            this.priceList = response.data;
            this.price =this.priceList[0].password;
            // localStorage.setItem('vipPrice', this.price);
          }).catch(function (err) {
          console.log(err)
        })
      }
    },
    mounted() {
      this.vipPrice();
    },
  }
</script>

<style scoped>
  .cancel {
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>
